home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
musicali
/
splib52d.lha
/
superplay-lib_DEV
/
Programmers
/
Oberon-2
/
Interfaces
/
spObjects.mod
next >
Wrap
Text File
|
1996-11-15
|
8KB
|
206 lines
(********************************************************************
:Program. spObjects.mod
:Contents. interface module for superplay objects
:Copyright. © 1994 by Andreas R. Kleinert
:Language. Oberon-2
:Translator. A+L Amiga Oberon Compiler V3.11d
:History. V2.1 indy 25-Dec-95 first translation of c include
:History. V2.2 indy 05-Jul-96 update: c include V2.2(21.10.1995)
*********************************************************************)
MODULE spObjects;
(*
$VER: spObjects 2.2 (5.7.96)
This Oberon-2 interface module contains the c-includes:
-------------------------------------------------------
spobjects/spobjectbase.h
Version : 1.2
Date : 18.01.1994
Written by : Andreas R. Kleinert
spobjects/spobjects.h
Version : 2.2
Date : 21.10.1995
Written by : Andreas R. Kleinert
*)
IMPORT
e *: Exec;
(*****************************************************************************)
TYPE
SPObjectBasePtr * = UNTRACED POINTER TO SPObjectBase;
ObjectNodePtr * = UNTRACED POINTER TO ObjectNode;
SampleListPtr * = UNTRACED POINTER TO SampleList;
SampleEntryPtr * = UNTRACED POINTER TO SampleEntry;
CheckFilePtr * = UNTRACED POINTER TO CheckFile;
ObjectNode * = STRUCT(node *: e.Node) (* chaining Node *)
version * : LONGINT; (* Library-Version of spobject *)
objectType * : LONGINT; (* see below *)
fileName * : ARRAY 108 OF CHAR; (* use 30, as in struct FileInfoBlock *)
typeID * : ARRAY 32 OF CHAR; (* e.g. "MED" *)
typeCode * : LONGINT; (* ... and its appropriate Code, , *)
(* assigned by superplay.library LATER. *)
subTypeNum * : LONGINT; (* actually available SubTypes *)
(* (maximum 16) of the spobject. *)
subTypeID * : ARRAY 16, 16 OF CHAR; (* e.g. "MMD0" or "MMD1" *)
subTypeCode * : ARRAY 16 OF LONGINT; (* ... and their appropriate Codes, *)
(* assigned by superplay.library LATER. *)
backgroundReplay * : LONGINT; (* Runs in the Background ? (Boolean) *)
(* size may grow with bigger spo_Version, see below *)
(* (No changes from V1 to V2 : accept both !) *)
END;
CONST
version - = 2; (* If this Version, which depends on the *)
(* spobject's Library-Version, is set, *)
(* it is guaranteed, that at least the *)
(* above information is available. *)
(* ^ DO NOT USE THIS DEFINE IN SOURCECODE ! *)
(* AVOID INCREASING IT VIA RECOMPILATION ! *)
objectTypeNone - = 0;
objectTypeUnknown - = objectTypeNone;
objectTypeIllegal - = 0FFFFFFFFH;
objectTypeSample - = 1; (* Raw Sample *)
objectTypeModule - = 2; (* Specific Sound Module *)
(* There may be more types in the future : simply reject unknown types. *)
(* ----------------------------------------------------------------------- *)
TYPE (* Header of "SampleEntry"-List *)
SampleList * = STRUCT(entryList *: e.List); (* List itself *)
numEntries * : LONGINT; (* number of entries in List *)
END;
SampleEntry * = STRUCT(node*: e.Node) (* may e.g. contain SampleData *)
(* the chaining Node *)
version * : LONGINT; (* SPObject's Version (2) *)
type * : LONGINT; (* Sample ? *)
(* The following entries are only valid, if type is == typeSample *)
sampleBuffer * : e.APTR; (* SampleData (CHIP-Ram) *)
sampleSize * : LONGINT; (* size of SampleData in Bytes *)
sampleBits * : LONGINT; (* 8, 16 *)
samplesPerSec * : LONGINT; (* as needed with audio.device *)
volume * : LONGINT; (* as needed with audio.device *)
(* more entries may follow in the future *)
END;
CONST
typeNone - = 0;
typeUnknown - = typeNone;
typeIllegal - = 0FFFFFFFFH;
typeSample - = 1; (* Entry contains Sample Data *)
(* There may be more types in the future : simply reject unknown types.
Do not examine unknown SampleEntry-Types. They may contain data,
which is structured different from the above in the future !
*)
(* -----------------------------------------------------------------------
This structure has to be passed to SPObject's SPO_CheckFileType()
function, if media other than SPO_MEDIUM_DISK are used for reading.
This is supported since superplay.library V2 and may be ignored by
SPObjects for compatibility reasons. To prevent older SPO_CheckFileType()
functions from crashing, superplay.library will create a dummy-file and
pass it's handle also ...
("You wanna something to check ? - Here you get it !")
In the V3-SPObject specification this structure may HAVE TO be
examined, then. In the current V2-specification this is not the case.
*)
TYPE
CheckFile * = STRUCT
medium * : LONGINT; (* MEDIUM_... *)
future * : LONGINT; (* as usual *)
END;
(* -----------------------------------------------------------------------*)
(* An external support-library for the superplay.library is called a
"spobject".
Each spobject has to contain a "SPO_ObjectNode" structure (as follows)
in its Library-Header, which later will be READ and MODIFIED by
the superplay.library.
Because the superplay.library supports three different sorts
of SPObjects at the time (internal, independent and external),
there are three different types of this structure (might be more in
the future), which can be identified via their "spo_ObjectType".
*)
(* The Construction of a spobject :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Library Base
----------------
Version MUST be 1 yet, Revision can be set freely
(see structure described below)
The Function Table
------------------
(see <pragmas/spobjects.h> or Reference_ENG.doc)
*)
(* *************************************************** *
* * * *
* * Library base Definition for spobjects * *
* * * *
* *************************************************** *)
TYPE
SPObjectBase - = STRUCT (libNode - : e.Library) (* Exec LibNode *)
spObject* : ObjectNodePtr; (* POINTER to initialized *)
(* SPO_ObjectNode *)
(* Define it somewhere else, *)
(* then initialize this pointer. *)
reserved*: ARRAY 32 OF LONGINT; (* Reserved for future expansion. *)
(* Always NULL yet (Version 1). *)
(*
Private data of the spobject, not to be accessed
by superplay.library, may follow.
*)
END;
VAR
base *: SPObjectBasePtr;
END spObjects.